

function doMultiSet(){
	document.getElementById('seltrans').value = '';
	ApplyFieldBoxes();

}

function doMultiChange(table_name){
	document.getElementById('seltrans').value = '';
	//ApplyFieldBoxes();
	get_selections(table_name);
	
	ms_form = document.getElementById(table_name + '_ms_form');
	ms_form.mode.value = 'Multichange';
	ms_form.submit();
	//document.multi_select_form.mode.value = 'Multichange';
	//document.multi_select_form.submit();
}

function doMultiDelete(table_name){
	//ApplyFieldBoxes();
	document.getElementById('seltrans').value = '';
	get_selections(table_name)	
	
	ms_form = document.getElementById(table_name + '_ms_form');
	//ms_form = document.getElementById('offices_ms_form');
	ms_form.mode.value = 'Multidelete';
	ms_form.submit();
	
	//document.multi_select_form.mode.value = 'Multidelete';
	//document.multi_select_form.submit();
}
// no longer used
function ApplyFieldBoxes()
	{
		usecomma = false;
		seltrans = document.getElementById('seltrans');
		//seltrans.value += 'Running';
		for(i=0; i<document.forms.length; i++)
		{
		//seltrans.value += 'inform';
			for(j=0; j<document.forms[i].elements.length; j++)
			{
			//seltrans.value += 'in type= ' += document.forms[i].elements[j].type;
			//seltrans.value += 'In name:' ;
			//seltrans.value += document.forms[i].elements[j].name;
				if(document.forms[i].elements[j].type=="checkbox"){
				//seltrans.value += 'In name:' ;
				//seltrans.value += document.forms[i].elements[j].name;		
					if((document.forms[i].elements[j].name=="addtochecked") && (document.forms[i].elements[j].checked)) {
						//seltrans.value += "THIS ONE IS CHECKED OF A KEY";
						if(usecomma){
						seltrans.value += ";";
						}
						seltrans.value += document.forms[i].elements[j].value;
						usecomma = true;
				
					}
				}
			
			}
		}
	
	}		
// no longer used	
function select_all()
{
for(i=0; i<document.forms.length; i++)
		{
		for(j=0; j<document.forms[i].elements.length; j++)
			{
				if(document.forms[i].elements[j].type=="checkbox"){
					if(document.forms[i].elements[j].name=="addtochecked") {
						//seltrans.value += document.forms[i].elements[j].value + ", ";
						document.forms[i].elements[j].checked = true;
					}
				}
			
			}
		}

}

// no longer used
function unselect_all()
{
for(i=0; i<document.forms.length; i++)
		{
		for(j=0; j<document.forms[i].elements.length; j++)
			{
				if(document.forms[i].elements[j].type=="checkbox"){
					if(document.forms[i].elements[j].name=="addtochecked") {
						//seltrans.value += document.forms[i].elements[j].value + ", ";
						document.forms[i].elements[j].checked = false;
					}
				}
			
			}
		}

}		
	
function select_by_name(table_name){
	selectboxes = document.getElementsByName(table_name + '_addto_ms');
	for(j=0; j<selectboxes.length; j++){
		selectboxes[j].checked = true;
		}
	
	//for (var sel_box in selectboxes){
	//	sel_box.checked = true;
	//	}

}

function unselect_by_name(table_name){
	selectboxes = document.getElementsByName(table_name + '_addto_ms');
	for(j=0; j<selectboxes.length; j++){
		selectboxes[j].checked = false;
		}
	
	//for (var sel_box in selectboxes){
	//	sel_box.checked = true;
	//	}

}

function get_selections(table_name){

	seltrans = document.getElementById('seltrans');
	usecomma = false;
	seltrans.value = '';

	selectboxes = document.getElementsByName(table_name + '_addto_ms');

	for(j=0; j<selectboxes.length; j++){
		if(selectboxes[j].checked){
			if(usecomma){
				seltrans.value += ';';
			}		
			seltrans.value += selectboxes[j].value;	
			usecomma = true;

		}
		
	}
}

function addMVentry(col_name){
	setvals = document.getElementById('CF_SETVALS');
	usecomma = false;
	current = setvals.value;
	
	if(setvals.value != ''){
		setvals += ',';
	}
	setvals += col_name;
	
}